#pragma once
#include "allocator.h"

struct ServiceDescriptorTable {
	void* ServiceTableBase;
	void* ServiceCounterTable;
	unsigned int NumberOfServices;
	void* ParamTableBase;
};
class ProcessEnhancer
{
#define _MAX_ENHANCE_PID_NUM 10
	UINT32 enhancePids[_MAX_ENHANCE_PID_NUM];
	bool bProcessNotifySet;
	bool bThreadNotifySet;
	void** EnhancedServiceTable;
	bool bOK;
	DECLARE_SINGLE_INSTANCE(ProcessEnhancer);
	static void ProcessRemoveNotify(IN HANDLE  ParentId,IN HANDLE  ProcessId,IN BOOLEAN  Create);
	static void ThreadCreateNotify(IN HANDLE  ProcessId,IN HANDLE  ThreadId,IN BOOLEAN  Create);

	bool EnhanceThread(PETHREAD pEthread);
public:
	ProcessEnhancer(void);
	~ProcessEnhancer(void);

	bool EnhanceProcess(UINT32 pid);
	void StopEnhanceProcess(UINT32 pid);
	bool IsProcessEnhanced(UINT32 pid);
	
};
